package StudyCode.summary.Basic.mylong;

import java.util.Arrays;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class LongArrayBinary {
	public static void main(String[] args) {
		long longArray[] = {1, 2, 4, 5};
		Arrays.sort(longArray);

		long searchValue = 2;
		long intResult = Arrays.binarySearch(longArray, searchValue);
		System.out.println("二分法查找 " + searchValue + " 的结果是: " + intResult);

		searchValue = 3;
		intResult = Arrays.binarySearch(longArray, searchValue);
		System.out.println("二分法查找 " + searchValue + " 的结果是: " + intResult);
	}
}
